package com.server.questionbank.snframe.controller.QuestionBan;

import com.server.questionbank.snframe.domain.QuestionBank.Knowledge;
import com.server.questionbank.snframe.domain.ResDTO.ResponseResult;
import com.server.questionbank.snframe.service.QuestionBank.KnowledgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/knowledge")

public class KnowledgePointController {
    @Autowired
    private  KnowledgeService knowledgePointService;

    // 按课程ID查询
    @GetMapping("/courseId")
    public ResponseResult<List<Knowledge>> getByCourseId() {
        List<Knowledge> points = knowledgePointService.getByCourseId();
        return ResponseResult.success(points);
    }
}
